//
//  ZYClientCell.m
//  MerChant_car
//
//  Created by STAR on 2017/11/22.
//  Copyright © 2017年 陈越. All rights reserved.
//

#import "ZYClientCell.h"
#import "UIView+ZY.h"
#import <Masonry/Masonry.h>
@interface ZYClientCell ()
@property (nonatomic, strong) UILabel *projectLabel;
@property (nonatomic, strong) UILabel *clientLabel;
@property (nonatomic, strong) UILabel *carLabel;
@property (nonatomic, strong) UILabel *telLabel;
@property (nonatomic, strong) UILabel *timeLabel;
@end

@implementation ZYClientCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configUI];
    }
    return self;
}
- (void)configUI {
    _projectLabel = [[UILabel alloc]init];
    _projectLabel.font = [UIFont systemFontOfSize:12];
    _projectLabel.text = @"项目";
    [self.contentView addSubview:_projectLabel];
    
    _clientLabel = [[UILabel alloc]init];
    _clientLabel.font = [UIFont systemFontOfSize:12];
    _clientLabel.text = @"项目";
    [self.contentView addSubview:_clientLabel];
    
    _carLabel = [[UILabel alloc]init];
    _carLabel.font = [UIFont systemFontOfSize:12];
    _carLabel.text = @"项目";
    [self.contentView addSubview:_carLabel];

    _telLabel = [[UILabel alloc]init];
    _telLabel.font = [UIFont systemFontOfSize:12];
    _telLabel.text = @"项目";
    [self.contentView addSubview:_telLabel];

    _timeLabel = [[UILabel alloc]init];
    _timeLabel.font = [UIFont systemFontOfSize:12];
    _timeLabel.text = @"项目";
    [self.contentView addSubview:_timeLabel];

}
- (void)awakeFromNib {
    [super awakeFromNib];
    [self masonrySubviews];
}
- (void)masonrySubviews {
    [_ibPLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@8);
        make.centerY.equalTo(self);
        make.right.equalTo(_ibNLabel.mas_left).offset(-8);
        
    }];
    [_ibNLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.right.equalTo(_ibNumLabel.mas_left).offset(-8);
    }];
    [_ibNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(_ibNLabel.mas_right).offset(8);
        make.centerY.equalTo(self);
        make.right.equalTo(_ibTelLabel.mas_left).offset(-8);
    }];
    [_ibTelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.right.equalTo(_ibTLabel.mas_left).offset(-8);
    }];
    [_ibTLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.right.equalTo(self).offset(-8);
    }];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [_projectLabel sizeToFit];
    _projectLabel.sn_left = 10;
    _projectLabel.sn_centerY = self.sn_centerY;
    
    [_clientLabel sizeToFit];
    _clientLabel.sn_left = _projectLabel.sn_right;
    _clientLabel.sn_centerY = _projectLabel.sn_centerY;
    
    [_carLabel sizeToFit];
    _carLabel.sn_left = _clientLabel.sn_right;
    _carLabel.sn_centerY = _projectLabel.sn_centerY;
    
    [_telLabel sizeToFit];
    _telLabel.sn_left = _carLabel.sn_right;
    _telLabel.sn_centerY = _projectLabel.sn_centerY;
    
    [_timeLabel sizeToFit];
    _timeLabel.sn_left = _telLabel.sn_right;
    _timeLabel.sn_centerY = _projectLabel.sn_centerY;
    _timeLabel.sn_right = self.sn_right - 10;
}
@end
